#include <iostream>
#include <string>
#include <stdio.h>
using namespace std;

long long ans[5000000];
int p1, p2, p3, n;
int t1, t2, t3;
int main()
{
    int i;
    long long min, temp;
    while (cin >> p1 >>p2 >>p3>> n)
    {
        t1 = t2 = t3 = 0;
        ans[0] = 1;
        for (i=1; i<=n; ++i)
        {
            min = ans[t1]*p1;
            temp = ans[t2]*p2;
            if (min > temp) min = temp;
            temp = ans[t3]*p3;
            if (min > temp) min =temp;
            ans[i] = min;
            if (ans[t1]*p1 == min) t1++;
            if (ans[t2]*p2 == min) t2++;
            if (ans[t3]*p3 == min) t3++;            
        }    
        cout << ans[n]<< endl;
    }    
    
    return 0;
}    